import ajax from '../utils/request'
import qs from 'qs'

export class Request{
    static get = (url:string,params?:any)=>{
        return new Promise((ress,rej)=>{
            ajax.get(url,qs.stringify({params:(params)})).then(res=>{
                ress(res)
            }).catch(err=>{
                rej(err)
            })
        })
    }
    static post = (url:string,params?:any)=>{
        return new Promise((ress,rej)=>{
            ajax.post(url,params).then(res=>{
                ress(res)
            }).catch(err=>{
                rej(err)
            })
        })
    }
}